package com.lintf.starter.admin;

import com.lintf.starter.api.UserDTO;
import com.lintf.starter.api.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

// 消费服务
@Service
public class BusinessService {
    // 通过接口引用远程服务
    @DubboReference(version = "1.0.0")
    private UserService userService;

    public void handleUser(Long userId) {
        UserDTO user = userService.getUserById(userId);
        System.out.println(user.getUserId() + " " + user.getUsername() + " " + user.getStatus());
        userService.updateUserStatus(userId, 1);
    }
}